646020c07418b6dbdd45b06c75910cc923c5cc83,findbugs/src/java/edu/umd/cs/findbugs/detect/FindUnrelatedTypesInGenericContainer.java,FindUnrelatedTypesInGenericContainer,FindUnrelatedTypesInGenericContainer,#BugReporter#,162
Before Change
String collectionSignature = "(Ljava/util/Collection<*>;)Z";
String indexSignature = "(Ljava/lang/Object;)I";
if (false) {
// Collection<E>
addToCollectionsMap(Collection.class.getName(), "contains", basicSignature, 0);
//addToCollectionsMap(Collection.class.getName(), "equals", basicSignature, 0);
addToCollectionsMap(Collection.class.getName(), "remove", basicSignature, 0);
//addToCollectionsMap(collectionMembers, "containsAll", collectionSignature, 0);
//addToCollectionsMap(collectionMembers, "removeAll", collectionSignature, 0);
//addToCollectionsMap(collectionMembers, "retainAll", collectionSignature, 0);
// List<E>
addToCollectionsMap(List.class.getName(), "indexOf", indexSignature, 0);
addToCollectionsMap(List.class.getName(), "lastIndexOf", indexSignature, 0);
// Map<K,V>
addToCollectionsMap(Map.class.getName(), "containsKey", basicSignature, 0);
addToCollectionsMap(Map.class.getName(), "containsValue", basicSignature, 1);
}
// Collection<E>
addToCollectionsMap(collectionMembers, "contains", basicSignature, 0);
//addToCollectionsMap(collectionMembers, "equals", basicSignature, 0);
addToCollectionsMap(collectionMembers, "remove", basicSignature, 0);
//addToCollectionsMap(collectionMembers, "containsAll", collectionSignature, 0);
//addToCollectionsMap(collectionMembers, "removeAll", collectionSignature, 0);
//addToCollectionsMap(collectionMembers, "retainAll", collectionSignature, 0);
// List<E>
addToCollectionsMap(listMembers, "indexOf", indexSignature, 0);
addToCollectionsMap(listMembers, "lastIndexOf", indexSignature, 0);
// Map<K,V>
addToCollectionsMap(mapMembers, "containsKey", basicSignature, 0);
addToCollectionsMap(mapMembers, "containsValue", basicSignature, 1);
// XXX these do not work, to support these need changeable return types
After Change
String indexSignature = "(Ljava/lang/Object;)I";
// Collection<E>
addToCollectionsMap(Collection.class.getName(), "contains", 0);
addToCollectionsMap(Collection.class.getName(), "remove", 0);
//addToCollectionsMap(collectionMembers, "containsAll", collectionSignature, 0);
//addToCollectionsMap(collectionMembers, "removeAll", collectionSignature, 0);
//addToCollectionsMap(collectionMembers, "retainAll", collectionSignature, 0);
// List<E>
addToCollectionsMap(List.class.getName(), "indexOf", 0);
addToCollectionsMap(List.class.getName(), "lastIndexOf", 0);
// Map<K,V>
addToCollectionsMap(Map.class.getName(), "containsKey", 0);
addToCollectionsMap(Map.class.getName(), "containsValue", 1);
// Map<K,V>
addToCollectionsMap(Map.class.getName(), "get", 0);